﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
using System.Web.Configuration;

namespace NTL
{
	public class NTLSection : ConfigurationSection
	{
		[ConfigurationProperty("connectionStringName", DefaultValue = "SqlServer")]
		public string ConnectionStringName { get { return (string)base["connectionStringName"]; } set { base["connectionStringName"] = value; } }

		public string ConnectionString { get { return WebConfigurationManager.ConnectionStrings[this.ConnectionStringName].ConnectionString; } }

		[ConfigurationProperty("enableCaching", DefaultValue = "true")]
		public bool EnableCaching { get { return (bool)base["enableCaching"]; } set { base["enableCaching"] = value; } }

		[ConfigurationProperty("cacheDuration", DefaultValue = "600")]
		public int CacheDuration { get { return (int)base["cacheDuration"]; } set { base["cacheDuration"] = value; } }
	}
}
